<?php

require '../model/vipmodel.php';

class vipcontrol{
	private $model;//业务模型
	private $view;

	public function __construct(){
		
		$this->view="../view/main.php?url=vipset.php";
		$this->model=new vipmodel();
		
		
	}


	public function load($view=null){
		if(empty($view))
		{				
			header("location:{$this->view}");
		}
		else{
			header("location:{$view}");
		}

	}
	public function doAction($action){


		if($action=='tian'){
			
			$this->action_tian();
		}
		
		else{
			$this->load();
		}

	}
	public function action_tian(){
		$tlevel=$_POST['tlevel'];
		$tjia=$_POST['tjia'];
		$tequan=$_POST['tequan'];
		if (!empty($tlevel)  ){//&& !empty($tjia) && !empty($tequan)  
			$tian=new vipmodel();
			$tian->viptian($tlevel,$tjia,$tequan);
		}
		//回自己界面
		$this->load($this->view);
		
	}
	
}
?>